#ifndef	_CARDEF_H_
#define	_CARDEF_H_

#include "def.h"

#define FLASH_SECTOR_SIZE	(1024*2)

#define BOOTLOADER_ADD	0x08000000
#define BOOTLOADER_SIZE	(1024*12)

#define UID_WRITE_ADD	(BOOTLOADER_ADD+BOOTLOADER_SIZE-4*4)
#define UID_GEN_ADD		(BOOTLOADER_ADD+BOOTLOADER_SIZE)

#define SYSTEM_CFG_REVERSED		(BOOTLOADER_ADD+BOOTLOADER_SIZE)
#define SYSTEM_CFG_FILE_SIZE	(SYSTEM_CFG_REVERSED+4)
#define SYSTEM_CFG_FILE_CRC		(SYSTEM_CFG_FILE_SIZE+4)
#define SYSTEM_CFG_FILE_UPDATE	(SYSTEM_CFG_FILE_CRC+4)

#define SYSTEM_STATE_SIZE	512
#define SYSTEM_VALID_PARA	0x12345678
#define SYSTEM_VALID_ADD	(BOOTLOADER_ADD+BOOTLOADER_SIZE+SYSTEM_STATE_SIZE-4)
#define SYSTEM_ADD			(BOOTLOADER_ADD+BOOTLOADER_SIZE+SYSTEM_STATE_SIZE)

#define RAM_ADD				0x20000000

#define UserProgramAddressEntry 	(0x08000000+1024*0)  //==BOOTLOADER_ADD

//#define INNER_FLASH_STORAGE_BT_RECORD_START	(0x08000000 + 252*1024)
//#define INNER_FLASH_STORAGE_BT_RECORD_SIZE	(1024*2)

#define INNER_FLASH_STORAGE_START	(0x08000000 + 62*1024)
#define INNER_FLASH_STORAGE_SIZE	(1024*2)

#define ID_FOR_STORAGE	0x9527000A

#endif

